//
//  UIView+CutScreen.m
//  Freemode
//
//  Created by xhl on 15/5/26.
//  Copyright © 2016年 贵州喜乐荟科技有限公司. All rights reserved.
//

#import "UIView+CutScreen.h"

@implementation UIView (CutScreen)

-(UIImage *)convertViewToImage

{
    
    UIGraphicsBeginImageContext(self.bounds.size);
    
    [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return image;
    
}

@end
